// @ts-ignore
/* eslint-disable */
import request from '@/request/http'

/** 修改头像 修改头像 PUT /anyone/avatar */
export async function avatar(body: API.DefUserAvatarUpdateVO, options?: { [key: string]: any }) {
  return request<API.RBoolean>(`/oauth/anyone/avatar`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 修改基础信息 PUT /anyone/baseInfo */
export async function updateBaseInfo(
  body: API.DefUserBaseInfoUpdateVO,
  options?: { [key: string]: any }
) {
  return request<API.RBoolean>(`/oauth/anyone/baseInfo`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 修改邮箱 修改邮箱 PUT /anyone/email */
export async function updateEmail(
  body: API.DefUserEmailUpdateVO,
  options?: { [key: string]: any }
) {
  return request<API.RBoolean>(`/oauth/anyone/email`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 查询单位和部门 GET /anyone/findCompanyDept */
export async function findCompanyDept(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.findCompanyDeptParams,
  options?: { [key: string]: any }
) {
  return request<API.ROrgResultVO>(`/oauth/anyone/findCompanyDept`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 根据单位查询部门 GET /anyone/findDeptByCompany */
export async function findDeptByCompany(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.findDeptByCompanyParams,
  options?: { [key: string]: any }
) {
  return request<API.RListBaseOrg>(`/oauth/anyone/findDeptByCompany`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 获取当前登录的用户信息 获取当前登录的用户信息：登录后，查询用户信息 GET /anyone/getUserInfoById */
export async function getUserInfoById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUserInfoByIdParams,
  options?: { [key: string]: any }
) {
  return request<API.RDefUserInfoResultVO>(`/oauth/anyone/getUserInfoById`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 修改手机 修改手机 PUT /anyone/mobile */
export async function updateMobile(
  body: API.DefUserMobileUpdateVO,
  options?: { [key: string]: any }
) {
  return request<API.RBoolean>(`/oauth/anyone/mobile`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 修改密码 修改密码 PUT /anyone/password */
export async function updatePassword(
  body: API.DefUserPasswordUpdateVO,
  options?: { [key: string]: any }
) {
  return request<API.RBoolean>(`/oauth/anyone/password`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}
